package com.liang.io;

import java.io.UnsupportedEncodingException;
import java.util.Arrays;

public class Utf8Text {
    public static void main(String[] args) throws UnsupportedEncodingException {
        byte[] bytes1 = "黑马程序员".getBytes();
        System.out.println(Arrays.toString(bytes1));


        byte[] bytes2 = "黑马程序员".getBytes("GBK");
        System.out.println(Arrays.toString(bytes2));

        String s1 = new String(bytes1);
        System.out.println(s1);

        String s2 = new String(bytes2,"gbk");
        System.out.println(s2);
    }
}
